package com.ccf.business.database.service.impl;

import com.common.model.result.CodeEnum;
import org.springframework.stereotype.Service;
import com.common.model.result.PageResult;
import com.common.model.pojo.Query;
import com.service.mybatis.util.Condition;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.service.mybatis.service.impl.SuperServiceImpl;

import lombok.extern.slf4j.Slf4j;

import com.ccf.business.database.model.TableCache;
import com.ccf.business.database.mapper.TableCacheMapper;
import com.ccf.business.database.service.ITableCacheService;

/**
 * 创建表信息缓存
 *
 * @author ccf
 * @date 2022-01-11 17:12:35
 */
@Slf4j
@Service
public class TableCacheServiceImpl extends SuperServiceImpl<TableCacheMapper, TableCache> implements ITableCacheService {
    /**
    * 列表
    * @param query
    * @return
    */
    @Override
    public PageResult<TableCache> findList(Query query){
        Page<TableCache> page = page(Condition.getPage(query), Condition.getQueryWrapper(query));
        return PageResult.<TableCache>builder().datas(page.getRecords()).code(CodeEnum.SUCCESS.getCode()).count(page.getTotal()).build();
    }
}
